package com.afkt.project.base.app;

import ohos.aafwk.ability.fraction.Fraction;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.ComponentContainer;
import ohos.agp.components.LayoutScatter;

public abstract class BaseFragment  extends Fraction {

    private Component rootView;

    @Override
    protected Component onComponentAttached(LayoutScatter scatter, ComponentContainer container, Intent intent) {
        rootView = scatter.parse(baseContentId(),null,false);
        onViewCreated(rootView);
        return rootView;
    }

    @Override
    public Component getComponent() {
        return rootView;
    }

    public abstract int baseContentId();
    public abstract void onViewCreated(Component rootView);
}
